package request

import "mime/multipart"

type ImageUpload struct {
	Business  string                `form:"business" json:"business" binding:"required"`
	ImageFile *multipart.FileHeader `form:"imageFile" json:"imageFile" binding:"required"`
	UserID    int                   `form:"userId" json:"userId" binding:"required"`
}

// 编写表单验证器
func (imageUpload ImageUpload) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"business.required":  "业务类型不能为空",
		"imageFile.required": "请选择图片",
		"userId.required":    "用户ID不能为空",
	}

}

/* 上传视频 */
type VideoUpload struct {
	Business    string                `form:"business" json:"business" binding:"required"`
	VideoFile   *multipart.FileHeader `form:"videoFile" json:"videoFile" binding:"required"`
	Title       string                `form:"title" json:"title" binding:"required"`
	Description string                `form:"description" json:"description" binding:"required"`
	UserID      int                   `form:"userId" json:"userId" binding:"required"`
	// CoverImageId string                `form:"CoverImageId" json:"coverImageId" binding:"required"`
	CoverPath string `form:"coverPath" json:"coverPath" binding:"required"`
	VideoPath string `form:"videoPath" json:"videoPath"`
}

func (videoUpload VideoUpload) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"userId":               "userId不能为空",
		"business.required":    "业务类型不能为空",
		"videoFile.required":   "请选择视频",
		"title.required":       "视频标题不能为空",
		"description.required": "视频描述不能为空",
		"coverPath.required":   "视频封面不能为空",
	}
}
